﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Parentmasterpage.master" CodeBehind="MyCruises.aspx.vb" Inherits="WebApplicationcruises.MyCruises" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <br />
    <table class="style12">
        <tr>
            <td>
                My Cruises</td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="CId" DataSourceID="SqlDataSourceCruisesTable" 
                    AllowSorting="True" Width="95%">
                    <Columns>
                        <asp:BoundField DataField="CId" HeaderText="CId" InsertVisible="False" 
                            ReadOnly="True" SortExpression="CId" Visible="False" />
                        <asp:TemplateField HeaderText="Pic" SortExpression="CThumbnail">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CThumbnail") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Image ID="Image2" runat="server" Height="35px" 
                                    ImageUrl='<%# Eval("CThumbnail") %>' Width="45px" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Title" SortExpression="CTitle">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("CTitle") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server" 
                                    NavigateUrl='<%# Eval("CId", "Details.aspx?id={0}") %>' 
                                    Text='<%# Eval("CTitle") %>'></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="CCreatedate" HeaderText="Createdate" 
                            SortExpression="CCreatedate" DataFormatString="{0:dd-MM-yyyy}" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style="text-align: right">
                <asp:SqlDataSource ID="SqlDataSourceCruisesTable" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionStringDB %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionStringDB.ProviderName %>" 
                    SelectCommand="SELECT * FROM [CruisesTable] WHERE ([Cuserid] = ?)">
                    <SelectParameters>
                        <asp:SessionParameter Name="Cuserid" SessionField="UserId" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                            <asp:Button ID="Button2" runat="server" Text="Add A new Cruise" />
                        </td>
        </tr>
    </table>
</asp:Content>
